home *** CD-ROM | disk | FTP | other *** search
/ Aminet 50 / Aminet 50 (2002)(GTI - Schatztruhe)[!][Aug 2002].iso / Aminet / text / edit / tecoc-146.lha / detab.tes < prev    next >
Text File  |  1991-07-11  |  1KB  |  45 lines

  1. !   Author:     John Guidi,  sped up by Pete Siemsen
  2.     Date:       20-July-79
  3.  
  4.     Useage:     MUNG DETAB filespec
  5.  
  6.     Abstract:   All tabs in the file specified will be replaced with
  7.                 spaces. Tab stops are assumed to be at every 8 spaces.
  8. !
  9.  
  10. 
  11. ********************************************************
  12.    This macro will read the file and transform all <TAB>
  13. characters into the appropriate number of <SPACE> chars.
  14. Note that tab stops are assumed to be at every 8 spaces.
  15. ********************************************************
  16. 
  17.  
  18. @^UF%EB%              ! set F up with EB command !
  19. H:XF                  ! append filespec to F !
  20. 27@:^UF%%             ! append <ESC> to F !
  21.  
  22. HK                    ! clear text buffer !
  23. MF                    ! execute F to open input and output files !
  24. Y                     ! pull first page into text buffer !
  25.  
  26. <
  27.   :@N/    /"U1;'        ! search for a tab,  leave loop when unsuccessful !
  28.   .UB                 ! put current pointer in B !
  29.   0L .UA              ! put pointer to begining of line in A !
  30.   QB-QAUC             ! put how many characters up to TAB in C !
  31.   <                   ! subtract 8 until QC is less than 9 !
  32.     QC-9"L
  33.       1;
  34.     '
  35.     -8%C
  36.   >
  37.   9-QCUD              ! put number of spaces into D !
  38.   @S/    /-D           ! find the tab again and delete it !
  39.   QD<                 ! insert the spaces !
  40.     @I/ /
  41.   >
  42. >
  43. EX                    ! close files !
  44.